home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / laptop-mode-tools / modules / runtime-pm < prev    next >
Encoding:
Text File  |  2012-05-20  |  826 b   |  31 lines

  1. #! /bin/sh
  2. # Laptop mode tools module: Runtime Power Management
  3. #
  4.  
  5.  
  6. activate_runtime_suspend() {
  7.     for device in $1/*; do
  8.         if [ -f $device/power/control ]; then
  9.             echo "auto" > $device/power/control;
  10.             log "VERBOSE" "Setting Runtime PM auto for device $device"
  11.         else
  12.             log "VERBOSE" "$device does not support Runtime PM"
  13.         fi
  14.     done
  15.  
  16. }
  17.  
  18. if [ x$CONTROL_RUNTIME_PM = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_RUNTIME_PM = xauto ]; then
  19.     log "VERBOSE" "Activating Runtime PM for device type PCI"
  20.     activate_runtime_suspend "/sys/bus/pci/devices"
  21.  
  22.     log "VERBOSE" "Activating Runtime PM for device type SPI"
  23.     activate_runtime_suspend "/sys/bus/spi/devices"
  24.  
  25.     log "VERBOSE" "Activating Runtime PM for device type i2c"
  26.     activate_runtime_suspend "/sys/bus/i2c/devices"
  27. else
  28.     log "VERBOSE" "Linux Runtime PM disabled."
  29. fi
  30.